/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.converter-header {
    text-align: center;
    margin-bottom: 30px;
    color: #4a6fa5;
}

.converter-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.converter-header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* 主内容样式 */
.converter-main {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* 转换类型选择 */
.conversion-type {
    margin-bottom: 30px;
    text-align: center;
}

.conversion-type label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
}

.conversion-type select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.conversion-type select:focus {
    border-color: #4a6fa5;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

/* 表单样式 */
.converter-form {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #4a6fa5;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

/* 单位选择器 */
.unit-selectors {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.unit-selectors .input-group {
    flex: 1;
    margin-bottom: 0;
}

.swap-btn {
    padding: 10px 15px;
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
}

.swap-btn:hover {
    background: #3a5a8a;
    transform: rotate(180deg);
}

/* 结果显示 */
.result-container,
.formula-container {
    margin-bottom: 20px;
}

.result-container label,
.formula-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 70px;
}

.formula-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #4a6fa5;
    font-family: 'Courier New', monospace;
    color: #666;
    text-align: center;
}

/* 历史记录 */
.recent-history {
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.recent-history h3 {
    margin-bottom: 15px;
    color: #4a6fa5;
    font-size: 1.2rem;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.no-history {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px 0;
}

.history-item {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-value {
    font-weight: bold;
    color: #667eea;
}

.history-unit {
    color: #666;
}

/* 货币信息提示 */
.currency-info {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #ffeaa7;
    font-size: 0.9rem;
    display: none;
}

#rate-update-time {
    font-weight: bold;
    color: #856404;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .converter-header h1 {
        font-size: 2rem;
    }
    
    .converter-main {
        padding: 20px;
    }
    
    .unit-selectors {
        flex-direction: column;
    }
    
    .unit-selectors .input-group {
        width: 100%;
    }
    
    .swap-btn {
        transform: rotate(90deg);
    }
    
    .swap-btn:hover {
        transform: rotate(270deg);
    }
    
    .result-box {
        font-size: 1.3rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-box,
.formula-box,
.history-item {
    animation: fadeIn 0.3s ease-out;
}